<app-back-btn></app-back-btn>
<div class="page-title">
  <span class="title" *ngIf="!this.code">添加Supplier</span>
  <span class="title" *ngIf="this.code">修改Supplier</span>
</div>

<div class="panel panel-body">
  <form nz-form [formGroup]="validateForm" class="form-wrap" (submit)="addSupplier($event)">
    <h2 class="subtitle">Supplier信息</h2>

    <!--name start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="name" nzRequired>供应商名</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('name')">
        <input nz-input formControlName="name" type="text" id="name" placeholder="供应商名称 最长32个汉字 64个英文">
        <nz-form-explain *ngIf="getFormControl('name').dirty&&getFormControl('name').errors">
          <ng-container *ngIf="getFormControl('name').hasError('required')">请输入供应商名称 最长32个汉字 64个英文</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        供应商名称 最长32个汉字 64个英文
      </nz-form-control>
    </nz-form-item>

    <!--englishName start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="englishName" nzRequired> 英文名</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('englishName')">
        <input nz-input formControlName="englishName" type="text" id="englishName" placeholder="英文名">
        <nz-form-explain *ngIf="getFormControl('englishName').dirty&&getFormControl('englishName').errors">
          <ng-container *ngIf="getFormControl('englishName').hasError('required')">请输入英文名</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        英文名
      </nz-form-control>
    </nz-form-item>

    <!--contacts start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="contacts" nzRequired> 联系人</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('contacts')">
        <input nz-input formControlName="contacts" type="text" id="contacts" placeholder="联系人">
        <nz-form-explain *ngIf="getFormControl('contacts').dirty&&getFormControl('contacts').errors">
          <ng-container *ngIf="getFormControl('contacts').hasError('required')">请输入联系人</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        联系人
      </nz-form-control>
    </nz-form-item>

    <!--bank start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="bank" nzRequired>最长32</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('bank')">
        <input nz-input formControlName="bank" type="text" id="bank" placeholder="最长32个汉字 64个英文">
        <nz-form-explain *ngIf="getFormControl('bank').dirty&&getFormControl('bank').errors">
          <ng-container *ngIf="getFormControl('bank').hasError('required')">请输入最长32个汉字 64个英文</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        最长32个汉字 64个英文
      </nz-form-control>
    </nz-form-item>

    <!--bankAccount start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="bankAccount" nzRequired>开户行账</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('bankAccount')">
        <input nz-input formControlName="bankAccount" type="text" id="bankAccount" placeholder="开户行账户">
        <nz-form-explain *ngIf="getFormControl('bankAccount').dirty&&getFormControl('bankAccount').errors">
          <ng-container *ngIf="getFormControl('bankAccount').hasError('required')">请输入开户行账户</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        开户行账户
      </nz-form-control>
    </nz-form-item>

    <!--paymentTerm start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="paymentTerm" nzRequired>支付方式</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('paymentTerm')">
        <input nz-input formControlName="paymentTerm" type="text" id="paymentTerm" placeholder="支付方式 ">
        <nz-form-explain *ngIf="getFormControl('paymentTerm').dirty&&getFormControl('paymentTerm').errors">
          <ng-container *ngIf="getFormControl('paymentTerm').hasError('required')">请输入支付方式 </ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        支付方式 
      </nz-form-control>
    </nz-form-item>

    <!--creditRating start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="creditRating" nzRequired> 信用等级</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('creditRating')">
        <input nz-input formControlName="creditRating" type="text" id="creditRating" placeholder="信用等级">
        <nz-form-explain *ngIf="getFormControl('creditRating').dirty&&getFormControl('creditRating').errors">
          <ng-container *ngIf="getFormControl('creditRating').hasError('required')">请输入信用等级</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        信用等级
      </nz-form-control>
    </nz-form-item>

    <!--supplierCategoryCode start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="supplierCategoryCode" nzRequired>供应商类</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('supplierCategoryCode')">
        <input nz-input formControlName="supplierCategoryCode" type="text" id="supplierCategoryCode" placeholder="供应商类型编码">
        <nz-form-explain *ngIf="getFormControl('supplierCategoryCode').dirty&&getFormControl('supplierCategoryCode').errors">
          <ng-container *ngIf="getFormControl('supplierCategoryCode').hasError('required')">请输入供应商类型编码</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        供应商类型编码
      </nz-form-control>
    </nz-form-item>

    <!--website start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="website" nzRequired> 公司官网</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('website')">
        <input nz-input formControlName="website" type="text" id="website" placeholder="公司官网">
        <nz-form-explain *ngIf="getFormControl('website').dirty&&getFormControl('website').errors">
          <ng-container *ngIf="getFormControl('website').hasError('required')">请输入公司官网</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        公司官网
      </nz-form-control>
    </nz-form-item>

    <!--address start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="address" nzRequired>地址 6</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('address')">
        <input nz-input formControlName="address" type="text" id="address" placeholder="地址 64个汉字，128个英文字符">
        <nz-form-explain *ngIf="getFormControl('address').dirty&&getFormControl('address').errors">
          <ng-container *ngIf="getFormControl('address').hasError('required')">请输入地址 64个汉字，128个英文字符</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        地址 64个汉字，128个英文字符
      </nz-form-control>
    </nz-form-item>

    <!--englishAddress start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="englishAddress" nzRequired> 英文地址</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('englishAddress')">
        <input nz-input formControlName="englishAddress" type="text" id="englishAddress" placeholder="英文地址">
        <nz-form-explain *ngIf="getFormControl('englishAddress').dirty&&getFormControl('englishAddress').errors">
          <ng-container *ngIf="getFormControl('englishAddress').hasError('required')">请输入英文地址</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        英文地址
      </nz-form-control>
    </nz-form-item>

    <!--email start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="email" nzRequired> 电子邮箱</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('email')">
        <input nz-input formControlName="email" type="text" id="email" placeholder="电子邮箱">
        <nz-form-explain *ngIf="getFormControl('email').dirty&&getFormControl('email').errors">
          <ng-container *ngIf="getFormControl('email').hasError('required')">请输入电子邮箱</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        电子邮箱
      </nz-form-control>
    </nz-form-item>

    <!--fax start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="fax" nzRequired> 传真号</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('fax')">
        <input nz-input formControlName="fax" type="text" id="fax" placeholder="传真号">
        <nz-form-explain *ngIf="getFormControl('fax').dirty&&getFormControl('fax').errors">
          <ng-container *ngIf="getFormControl('fax').hasError('required')">请输入传真号</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        传真号
      </nz-form-control>
    </nz-form-item>

    <!--mobile start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="mobile" nzRequired> 移动电话</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('mobile')">
        <input nz-input formControlName="mobile" type="text" id="mobile" placeholder="移动电话">
        <nz-form-explain *ngIf="getFormControl('mobile').dirty&&getFormControl('mobile').errors">
          <ng-container *ngIf="getFormControl('mobile').hasError('required')">请输入移动电话</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        移动电话
      </nz-form-control>
    </nz-form-item>

    <!--telephone start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="telephone" nzRequired> 固定电话</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('telephone')">
        <input nz-input formControlName="telephone" type="text" id="telephone" placeholder="固定电话">
        <nz-form-explain *ngIf="getFormControl('telephone').dirty&&getFormControl('telephone').errors">
          <ng-container *ngIf="getFormControl('telephone').hasError('required')">请输入固定电话</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        固定电话
      </nz-form-control>
    </nz-form-item>

    <!--zipCode start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="zipCode" nzRequired> 邮编</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('zipCode')">
        <input nz-input formControlName="zipCode" type="text" id="zipCode" placeholder="邮编">
        <nz-form-explain *ngIf="getFormControl('zipCode').dirty&&getFormControl('zipCode').errors">
          <ng-container *ngIf="getFormControl('zipCode').hasError('required')">请输入邮编</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        邮编
      </nz-form-control>
    </nz-form-item>

    <!--companyNature start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="companyNature" nzRequired>公司性质</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('companyNature')">
        <input nz-input formControlName="companyNature" type="text" id="companyNature" placeholder="公司性质 国营 state_run ,民营privately operated，合资joint venture，外资 foreign capital">
        <nz-form-explain *ngIf="getFormControl('companyNature').dirty&&getFormControl('companyNature').errors">
          <ng-container *ngIf="getFormControl('companyNature').hasError('required')">请输入公司性质 国营 state_run ,民营privately operated，合资joint venture，外资 foreign capital</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        公司性质 国营 state_run ,民营privately operated，合资joint venture，外资 foreign capital
      </nz-form-control>
    </nz-form-item>

    <!--summary start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="summary" nzRequired>备注 1</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('summary')">
        <input nz-input formControlName="summary" type="text" id="summary" placeholder="备注 128 个汉字说明">
        <nz-form-explain *ngIf="getFormControl('summary').dirty&&getFormControl('summary').errors">
          <ng-container *ngIf="getFormControl('summary').hasError('required')">请输入备注 128 个汉字说明</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        备注 128 个汉字说明
      </nz-form-control>
    </nz-form-item>

    <!--表单底部start-->
    <nz-form-item class="action-button">
      <nz-form-control class="text-center">
        <button nz-button nzSize="large" [nzType]="'primary'" class="pl-30 pr-30" [nzLoading]="isConfirmLoading">
          {{'Btn0009'| translate}}
        </button>
      </nz-form-control>
    </nz-form-item>
    <!--表单底部end-->
  </form>

</div>
